package rickyGame.game.property
{
	
	import ricky.game.Actor;
	
	import rickyGame.game.Fighter;

	/**
	 * 角色的ai配置
	 */
	public class Ai
	{
		public function Ai(p:Fighter)
		{
			_self=p;
			_percept=[];
		}
		
		/**
		 * 根初始化ai
		 */
		public function init(perception:String):void
		{
			if(perception)
			_percept=perception.split(",");
		}

		/**
		 * ai行为树
		 */
		public function get aitree():Array
		{
			return _aitree;
		}

		public function get lastPercept():String
		{
			return _lastPercept;
		}

		/**
		 * 上次感知
		 */
		public function set lastPercept(value:String):void
		{
			_lastPercept = value;
		}

		/**
		 * 当前感知
		 */
		public function get currPercept():String
		{
			return _currPercept;
		}

		public function set currPercept(value:String):void
		{
			_currPercept = value;
		}

		/**
		 * 
		 * 感知列表
		 */
		public function get percept():Array
		{
			return _percept;
		}

		public function set percept(value:Array):void
		{
			_percept = value;
		}

		/**
		 * 当前锁定的目标
		 */
		public function get lockedTarget():Fighter
		{
			return _lockedTarget;
		}

		public function set lockedTarget(value:Fighter):void
		{
			_lockedTarget = value;
		}

		public function get hurtMe():Fighter
		{
			return _hurtMe;
		}

		public function set hurtMe(value:Fighter):void
		{
			_hurtMe = value;
		}
		
		private var _lastPercept:String;
		private var _currPercept:String;
		private var _percept:Array;//感知列表
		private var _self:Fighter;//自己
		private var _lockedTarget:Fighter;//锁定的目标
		private var _aitree:Array;
		private var _hurtMe:Fighter;//伤害我的人；
		
		public var localX:Number;
		public var localY:Number;
	}
}